<template>
    <div>
        <h2>子组件</h2>
        <div>
            {{ count }}
            <div>
                <strong>{{ pcount }}</strong>
            </div>
            <button @click="count++">+</button>
        </div>
    </div>
  </template>
  
  <script lang='ts' setup>
  import {onBeforeMount,onMounted,onBeforeUpdate,onUpdated,onBeforeUnmount,onUnmounted,defineProps} from 'vue'
  import {ref} from 'vue'
  const count=ref<number>(0)
  defineProps<{pcount:number}>()
  onBeforeMount(()=>{
    console.log('=====child的onBeforeMount======');
  })
  onMounted(()=>{
    console.log('=====child的onMounted======');
  })
  onBeforeUpdate(()=>{
    console.log('=====child的onBeforeUpdate======');
  })
  onUpdated(()=>{
    console.log('=====child的onUpdated======');
  })
  onBeforeUnmount(()=>{
    console.log('=====child的onBeforeUnmount======');
  })
  onUnmounted(()=>{
    console.log('=====child的onUnmounted======');
  })
  
  </script>
  
  <style lang='scss' scoped>
  </style>